package com.one.service.impl;

import com.one.bean.Product;
import com.one.mapper.ProductMapper;
import com.one.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * Create on 2022-01-17
 * <p>
 * Author: LiangWei
 * <p>
 * Description:
 **/
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public Product selectProductByProdId(Integer prodId) {
        return productMapper.selectById(prodId);
    }

    @Override
    public boolean judgeProductPurchaseAndStatus(Integer prodId) {
        Product product = productMapper.selectById(prodId);
        return product.getPurchase()==1;
    }
}
